﻿namespace Utilities
{
    /// <summary>
    /// 自定义异常，用于处理程序主动报错给客户端警告（比如数据验证失败）
    /// </summary>
    public class CustomException : Exception
    {
        public int Code { get; set; }

        public CustomException(string msg, int code = 1)
            : base(msg)
        {
            this.Code = code;
        }
        public CustomException(string msg, int code, Exception innerException)
    : base(msg, innerException)
        {
            this.Code = code;
        }
    }
}
